package com.taylor.service.impl;

import com.taylor.entity.User;
import com.taylor.service.UserService;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.UnsupportedEncodingException;

/**
 * Created by 357070 on 2016/9/10.
 */
@Service
public class UserServiceImpl implements UserService{

    @ResponseBody
    public User getUser(@PathVariable String name) {
        System.out.println("我的名字：" + name);
        User u = new User();
        u.setName(name);
        u.setAge(20);
        return u;
    }

    @ResponseBody
    public User getUser(@RequestBody User user) {
        return user;
    }
}
